//
//  QDMPItemButtonCollectionViewCell.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/4/28.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit


/// 放在主页functionList的集合视图
final class QDMPItemButtonCollectionViewCell: NWCollectionViewCell {
    /// 展示的图片
    @objc let imageView = UIImageView()
    /// 显示的标题
    let titleLabel = UILabel()
    
    
    override func buildView() {
        super.buildView()
        
        imageView.clipsToBounds = true
        imageView.contentMode = .scaleAspectFit
        titleLabel.text = "地铁新闻"
        titleLabel.textAlignment = .center
        titleLabel.textColor = QDColors.black
        titleLabel.font = Font.regular.font(size: 12)
        
        contentView.addSubview(imageView)
        contentView.addSubview(titleLabel)
        
        imageView.snp.makeConstraints { (make) in
            make.left.top.right.equalToSuperview()
            make.width.lessThanOrEqualTo(92).priority(.high)
            make.height.equalTo(imageView.snp.width).multipliedBy(48.0 / 92)
        }
        
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalTo(imageView.snp.bottom).offset(2)
            make.left.right.equalToSuperview()
            make.height.equalTo(17)
        }
    }
}
